{% extends "start.html" %}


{% block extraTitle %}- My Items{% endblock %}

{% block topbar %}
    {% if logged %}
        &emsp;Welcome back!
        &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
        &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
        <a href="/logout/">Logout</a>
    {% else %}
        &emsp;&emsp;&emsp;&emsp;&emsp;
        &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
        &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
        <a href="/login/">Login here!</a>
    {% endif %}
{% endblock %}

{% block pageTitle %}My Items{% endblock %}
{% block sectionTitle %}All my items{% endblock %}


{% block content %}    
    
    {% if logged %}
        {% if my_items|length <= 0 %}
            <font size="6"><center>Maybe it's time to buy something new.</center></font><br />
            <font size="4">Go to <a href="/items/">Items</a>, find something usefull or fancy and buy it. Maybe it can help you.</font>
        {% else %}

            <table>
                <tr>
                    <td>&emsp;</td>
                    <td><center><strong>-Name-</strong></center></td>
                    <td><center><strong>-What is this?-</strong></center></td>
                    <td><center><strong>-It gives me-</strong></center></td>
                    <td><center><strong>-Level-</strong></center></td>
                    <td><center><strong>-I spent(wisely)-</strong></center></td>
                </tr>
                {% for x in my_items %}                    
                    <tr>
                        <td><img src="../static/items/{{x.theitem.name}}.jpg" width="60" height="60"></td>
                        <td><center>{{ x.theitem.name }}</center></td>
                        <td>{{ x.theitem.description }}</td>
                        <td><center>Energy +{{ x.theitem.energy_boost }}</center></td>
                        <td><center>{{ x.theitem.level_required }}.0</center></td>
                        <td><center>$ {{ x.theitem.cost }}</center></td>
                    </tr>
                {% endfor %}
            </table>

        {% endif %}        
    {% else %}
        <font size="9"><center><a href="/login/">Login and take a look to your items</a></center></font>
    {% endif %}
    
    
{% endblock %}


{% block profile %}
    {% block level %}
        <img src="../static/levels/{{profile.level}}.0.jpg"  width="84" height="80">
    {% endblock %}
    <font size="3">
        <ul>
            <li>EXP: {{ profile.experience }} </li>
            <li>${{ profile.money }}.00 </li>
            <li>Energy :{{ profile.energy }}/{{profile.total_energy}} </li>
        </ul>
    </font>
{% endblock %}